package com.demo2do.boyle.backend.dao;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.demo2do.boyle.common.entity.customer.Customer;
import com.demo2do.boyle.common.entity.customer.message.CustomerMessage;
import com.demo2do.boyle.common.entity.customer.message.Type;
import com.demo2do.core.persistence.GenericDaoSupport;

/**
 * 
 * @author mohanlan
 *
 */
@Repository("customerMessageDaoSupport")
public class CustomerMessageDaoSupport {
	
	@Autowired
	private GenericDaoSupport genericDaoSupport;
	
	/**
	 * 
	 * @param customer
	 * @param content
	 * @param type
	 */
	public void create(Customer customer, String content, Type type) {
		CustomerMessage customerMessage = new CustomerMessage(customer, content, type);
		genericDaoSupport.save(customerMessage);
	}

}
